package top.wanzc.java.basic.jdk8.feature;

import java.util.function.Consumer;
import java.util.function.Supplier;

public class BuildInFunctionInterfaceDemo {
	
	static class Dog {
		
		Dog() {
			System.out.println("new Dog");
		}
		
		public static void shout(Dog dog) {
			System.out.println("shout");
		}
		
		public void eat() {
			System.out.println("eat");
		}
		
		public void run(Dog dog) {
			System.out.println("run");
		}
		
	}
	
	public static void main(String[] args) {
		Supplier<Dog> dogSupplier = Dog::new;
		System.out.println(dogSupplier.getClass());
		Dog d = dogSupplier.get();
		
		Consumer<Dog> dogConsumer1 = Dog::shout;
		dogConsumer1.accept(d);
		
		Consumer<Dog> dogConsumer2 = Dog::eat;
		dogConsumer2.accept(d);
		
		Consumer<Dog> dogConsumer3 = d::run;
		dogConsumer3.accept(d);
		System.out.println(dogConsumer3.toString());
		
		
		
		
	}

}
